from django.contrib import admin
from .models import Book,Author

admin.site.index_title="图书管理系统首页"
admin.site.site_title="图书管理页"
admin.site.site_header="图书管理"

class Bookadmin(admin.ModelAdmin):
    list_display = ['id','name','price','isbn_no']
    ordering = ['-price','id']
    list_filter = 5

admin.site.register(Book,Bookadmin)

@admin.register(Author)
class AuthorAdmin(admin.ModelAdmin):
    list_display = ['id','name','sex']
    search_fields = ['name','sex']